const data = [
    {
        id: 1,
        text: '节点1',
        parentId: 0,
        children: [
            {
                id: 2,
                text: '节点1_1',
                parentId: 1
            }
        ]
    }
]
let res = []
function treeToList(tree) {

    Array.from(tree).forEach((item) => {
        const {id,text,parentId,children} = item
        res.push({
            id:id,
            text:text,
            parentId:parentId
        })
        if (children) {
            treeToList(children)
        }
    })
    return res
}

console.log(treeToList(data));
